package com.situ.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import com.situ.service.SyEmpareapowerService;
import com.situ.entity.SyEmpareapower;
import java.util.*;
/**
 * SyEmpareapower的路由接口服务
 * 
 * @author 胡文
 *
 */
@Controller
public class SyEmpareapowerController {

	/** SyEmpareapowerService服务 */
	@Autowired
	private SyEmpareapowerService syEmpareapowerService;
	
	/**
	 * 查询所有SyEmpareapower数据的方法
	 * @param value
	 * @return
	 */
	@RequestMapping(value = "querySyEmpareapower", produces = {"application/json;charset=UTF-8"})
	public String find(SyEmpareapower value,Map map) {
		 List<SyEmpareapower> list= syEmpareapowerService.find(value);
         map.put("items",list);
         return "页面名称自己改";
	}
	
	/**
	 * 通过id查询SyEmpareapower数据的方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "querySyEmpareapowerById/{id}", produces = {"application/json;charset=UTF-8"})
	public String findOne(@PathVariable(name="id") Object id,Map map) {
        SyEmpareapower obj=  syEmpareapowerService.findOne(id);
        map.put("SyEmpareapower",obj);
        return "页面名称自己改";
	}
	
	/**
	 * 插入SyEmpareapower属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "saveSyEmpareapower", produces = {"application/json;charset=UTF-8"})
	public String save(SyEmpareapower value) {
		  syEmpareapowerService.saveNotNull(value);
        return "redirect:/querySyEmpareapower";
	}
	
	/**
	 * 更新SyEmpareapower属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "updateSyEmpareapower", produces = {"application/json;charset=UTF-8"})
	public String update(SyEmpareapower value) {
		  syEmpareapowerService.updateNotNullById(value);
          return "redirect:/querySyEmpareapower";
	}
	
	/**
	 * 通过id删除SyEmpareapower数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "delSyEmpareapowerById/{id}", produces = {"application/json;charset=UTF-8"})
	public String delete(@PathVariable(name="id") Object id) {
		  syEmpareapowerService.deleteById(id);
          return "redirect:/querySyEmpareapower";
	}
}
